package Stream;

import java.util.*;
import java.util.stream.Stream;

/*
* 获取stream流对象
*
* */
public class Demo1 {
    public static void main(String[] args) {
        //1、获取集合的stream
        Collection<String> list = new ArrayList<>();
        Stream<String> s1 = list.stream();
        //Map集合获取stream流
        Map<String, Integer> map = new HashMap<>();
        //三种遍历方式有着不同的获取stream流的方式
        Stream<Map.Entry<String, Integer>> s2 = map.entrySet().stream();

        //2、获取数据stream流
        String[] arr=new String[]{"rrr","rrr","rrr","rrr"};
        Stream<String> s3 = Arrays.stream(arr);
        Stream<String> s4 = Stream.of(arr);

    }
}
